namespace Gateway.Common.Extensions;

/// <summary>
/// 文件编号服务
/// </summary>
public class FileNoExtension
{
    /// <summary>
    /// 生成编号
    /// </summary>
    /// <returns></returns>
    public static string GenerateNumber()
    {
        var dateTimeStr = DateTime.Now.ToString("yyyyMMddHHmmssffff");
        var random = new Random(BitConverter.ToInt32(Guid.NewGuid().ToByteArray(), 0));
        var ranInt = random.Next(1000, 9999);
        return $"FILE{dateTimeStr}{ranInt}";
    }
}